<!DOCTYPE HTML>
<html>
<head>
<meta charset="utf-8">
<meta name="renderer" content="webkit|ie-comp|ie-stand">
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
<meta name="viewport" content="width=device-width,initial-scale=1,minimum-scale=1.0,maximum-scale=1.0,user-scalable=no" />
<meta http-equiv="Cache-Control" content="no-siteapp" />
<!--[if lt IE 9]>
<script type="text/javascript" src="lib/html5.js"></script>
<script type="text/javascript" src="lib/respond.min.js"></script>
<script type="text/javascript" src="lib/PIE_IE678.js"></script>
<![endif]-->
<link href="css/H-ui.min.css" rel="stylesheet" type="text/css" />
<link href="css/H-ui.admin.css" rel="stylesheet" type="text/css" />
<link href="css/style.css" rel="stylesheet" type="text/css" />
<link href="lib/Hui-iconfont/1.0.7/iconfont.css" rel="stylesheet" type="text/css" />
<!--[if IE 6]>
<script type="text/javascript" src="lib/DD_belatedPNG_0.0.8a-min.js" ></script>
<script>DD_belatedPNG.fix('*');</script>
<![endif]-->
<title>店铺列表</title>
</head>
<body>
<nav class="breadcrumb">
	<i class="Hui-iconfont">&#xe67f;</i> <a href="/Manage/">首页</a>  
	<span class="c-gray en">&gt;</span> <a href="/Manage/shop-list.html">店铺管理 </a>
	<span class="c-gray en">&gt;</span> 店铺列表 

	<a class="btn btn-success radius r mr-20 reload" style="line-height:1.6em;margin-top:3px" href="javascript:;" title="刷新" ><i class="Hui-iconfont">&#xe68f;</i></a>

	
	<span class="r" style="margin-top: -2px; box-sizing: border-box;">
		
		<select name="cid1" id="cid1" class="select" style="width: auto; height: 31px; vertical-align: middle;">
			<option value="" selected="">全部分类</option>
		</select>

		<select name="flag" id="flag" class="select" style="width: auto; height: 31px; vertical-align: middle;">
			<option value="" selected="">状态</option>
			<option value="0">关闭</option>
			<option value="1">显示</option>
		</select>
		<select name="is_recommend" id="is_recommend" class="select" style="width: auto; height: 31px; vertical-align: middle;">
			<option value="" selected="">推荐</option>
			<option value="0">否</option>
			<option value="1">是</option>
		</select>
		<select name="is_friend" id="is_friend" class="select" style="width: auto; height: 31px; vertical-align: middle;">
			<option value="" selected="">联盟</option>
			<option value="0">否</option>
			<option value="1">是</option>
		</select>
		<span style="position:relative">
			<input type="text" name="keywords" id="search-input" placeholder="家具店名称" style="width:250px" class="input-text">
			<i class="Hui-iconfont i-close" id="inputclear">&#xe706;</i>
		</span>
		<button name="" id="search" class="btn btn-success"><i class="Hui-iconfont">&#xe665;</i> 搜索</button>
	</span>

</nav>
<div class="pd-10">
	
	<div>
		<table class="table table-border table-bordered table-bg table-hover table-sort">
			<thead>
				<tr class="text-c sort0">
					<th class="valueid"><input name="" type="checkbox" value=""></th>
					<th class="fun-sort" data-name="agent_id" data-flag="0" width="60">ID</i></th>
					<th width="60">缩略图</th>
					<th >店铺名称</th>
					<th >联系电话</th>
					<th width="30%">行业分类</th>
					<th width="30%">店铺地址</th>
					<th class="fun-sort" data-name="agent_time" data-flag="0" width="80">加入时间</th>
					<th>状态</th>
					<th width="60">操作</th>
				</tr>
			</thead>
			<tbody id="content_sp">
			  
			</tbody>
		</table>
	</div>
	
	<div class="cl pd-5 bg-1 bk-gray mt-20 mb-20"> 
		<a href="javascript:;" class="btn btn-warning l mr-10 mt-5 radius fun-all" data-type="stop"><i class="Hui-iconfont">&#xe6de;</i> 批量关闭</a> 
		<a href="javascript:;" class="btn btn-success l mr-10 mt-5 radius fun-all" data-type="start"><i class="Hui-iconfont">&#xe603;</i> 批量开启</a> 
		<!-- <a href="javascript:;" class="btn btn-danger l mr-10 mt-5 radius fun-all" data-type="del"><i class="Hui-iconfont">&#xe6e2;</i> 批量删除</a>  -->
		<span class="r pt-5"  style="line-height: 35px;" id="page"></span>
		<span class="r mr-10"  style="line-height: 40px;" id="dataall"></span>  
	</div>
</div>

<!-- 店铺列表模版 -->
<script id="test" type="text/html">
  	<% for (x in list) { %>
	<tr class="text-c va-m sort1">
		<td class="valueid"><input name="" type="checkbox" value="<%=list[x].agent_id%>"></td>
		<td><%=list[x].agent_id%></td>
		<td class="text-l">
			<img class="pic-thumb" src="/Manage/images/blank.gif" data-lazy="<%=list[x].agent_logo%>">	
		</td>
		<td class="text-l" nowrap="nowrap"><a href="/Agent/detail.html?id=<%=list[x].agent_id%>" target="_blank"><%=list[x].agent_name%></a>
			<br>[ <%=list[x].member_name%> ]
		</td>
		<td class="text-l" nowrap="nowrap"><%=list[x].agent_mobile%><br><%=list[x].agent_phone%></td>
		<td class="text-l"><%=list[x].sc_name%></td>
		<td class="text-l"><%=list[x].agent_address%></td>
		<td class="text-l" nowrap="nowrap"><%=list[x].agent_time%></td>
		<td class="text-c td-status">
			<input type="checkbox" class="switch fun-start-stop" style="outline: none;" <%if(list[x].agent_state==1){ %>checked<% } %>/>
		</td>
		<td class="text-c td-operation">
			<input type="checkbox" class="inputboxt fun-tj" style="outline: none;" <%if(list[x].is_recommend==1){ %>checked<% } %>/>
			
			<input type="checkbox" class="inputboxh fun-hz" style="outline: none;" <%if(list[x].is_friend==1){ %>checked<% } %>/>
		</td>
	</tr>
	<%}%>   
</script>
<script type="text/javascript" src="lib/jquery/1.9.1/jquery.min.js"></script> 
<script type="text/javascript" src="lib/layer/2.1/layer.js"></script> 
<script type="text/javascript" src="js/H-ui.js"></script> 
<script type="text/javascript" src="js/H-ui.admin.js"></script>
<script src="/Public/js/template-native.js"></script> 
<script type="text/javascript" src="js/s.js"></script> 
<script type="text/javascript" src="lib/laypage/laypage.js"></script> 
<script src="/Manage/js/lazyload.min.js"></script>
<script type="text/javascript">
var kk=API_AGENT_LIST;//用于搜索和上下翻页
var API=API_AGENT_LIST;
loaddata(API,1,true);

$(document).ready(function(){ 

    

    // 筛选列表
    var gc;
    

    $.getJSON(API_SHOPCLASS,function(data){
    	if(!checkStatus(data)) return;
    	gc=data.datas;
        if(data.datas==''){
        	layer.msg('分类出错', {icon:5,time:1000});
        }else{
        	// 罗列一级分类
        	for(i=0; i<data.datas.length; i++){
        		$("#cid1").append("<option value='"+data.datas[i].sc_id+"' data-flag='"+i+"'>"+data.datas[i].sc_name+"</option>");
        	}
        	
        }      
    });

    // 筛选功能
	$("#search").click(function(){
		kk=API+"?";
		var param=[
			'k='+encodeURI(document.querySelector('input[name=keywords]').value),
			'cid1='+document.querySelector('select[name=cid1]').value,
			'is_recommend='+document.querySelector('select[name=is_recommend]').value,
			't='+document.querySelector('select[name=flag]').value,
			'is_friend='+document.querySelector('select[name=is_friend]').value,
		];
		kk=kk+param.join('&');
		loaddata(kk,1,true);

	})

   	//全选按钮
  	$("table thead th input:checkbox").on("click" , function(){
  		$(this).closest("table").find("tr > td:first-child input:checkbox").prop("checked",$("table thead th input:checkbox").prop("checked"));
    });

  	// 监听是否取消全选
  	$(document).on('click','tr.sort1 input:checkbox',function(){
  		var len=$("tr.sort1").length;
  		var t=0;
  		$("tr.sort1 input:checkbox").each(function(){
  			if($(this).is(':checked')){
  				t++;
  			}
  		})
  		if(len==t){
  			$("table thead th input:checkbox").prop("checked",true);
  			
  		}else{
  			$("table thead th input:checkbox").prop("checked",false);
  		}
  	})
    
})

</script> 
</body>
</html>